<template>
	<view class="u-page">
		<view style="padding-top: 30rpx;">
			<u-cell-group>
				<u-cell title="姓名" :value="userInfo.name"></u-cell>
				<u-cell title="手机号" :value="userInfo.phone"></u-cell>
				<u-cell title="民族" :value="userInfo.nation"></u-cell>
				<u-cell title="微信号" :value="userInfo.phone"></u-cell>
				<u-cell title="性别" :value="userInfo.sex == '1'?'男':'女'"></u-cell>
				<u-cell title="生日" :value="userInfo.birthday.slice(0,10)"></u-cell>
				<u-cell title="身高(cm)" :value="userInfo.height"></u-cell>
				<u-cell title="体重(kg)" :value="userInfo.weight"></u-cell>
				<u-cell title="就读/毕业院校" :value="userInfo.school"></u-cell>
				<u-cell title="最高学历" :value="userInfo.edu"></u-cell>
				<u-cell title="所在机构" :value="userInfo.deptName"></u-cell>
				<u-cell title="月收入(元)" :value="userInfo.income"></u-cell>
				<u-cell title="是否有房" :value="userInfo.isHouse == '0'? '无房':'有房'"></u-cell>
				<u-cell title="是否有车":value="userInfo.isCar == '0'? '无车':'有车'"></u-cell>
			</u-cell-group>
		</view>
	</view>
</template>

<script>
	var _self;
	import {
		getUserDetail
	} from '@/common/api.js'
	export default {
		data() {
			return {
				userInfo: {},
				nickName: '123123',
				sexStr: '',
				birthdayStr: '',
				heightStr: '',
				weightStr: '',
				workStr: '',
				incomeStr: '',
				educationStr: '',
				cityStr: '',
				sexShow: false,
				sexList: [{
					value: '男',
					label: '男'
				}, {
					value: '女',
					label: '女'
				}],
				birthdayShow: false,
				cityShow: false,
				educationShow: false,
				educationList: [{
						value: '无',
						label: '无'
					}, {
						value: '小学',
						label: '小学'
					},
					{
						value: '初中',
						label: '初中'
					}, {
						value: '高中',
						label: '高中'
					},
					{
						value: '中专',
						label: '中专'
					}, {
						value: '大专',
						label: '大专'
					},
					{
						value: '本科',
						label: '本科'
					}, {
						value: '硕士',
						label: '硕士'
					},
					{
						value: '博士',
						label: '博士'
					}, {
						value: '博士后',
						label: '博士后'
					},
					{
						value: '院士',
						label: '院士'
					}
				]
			}

		},

		onShow() {},
		onLoad() {
			_self = this;
			_self.getUserInfo();
		},
		methods: {
			getUserInfo() {
				getUserDetail({
					userId: this.vuex_userid
				}).then(res => {
					this.userInfo = res.data;

				}).catch({

				})
			},
			nickNameInput(e) {
				_self.nickName = e.detail.value;
				console.log('_self.nickName  = ', _self.nickName);
			},
			sexClick() {
				_self.sexShow = true;
			},
			sexConfirm(e) {
				_self.sexShow = false;
				_self.sexStr = e[0].label;
			},
			birthdayClick() {
				_self.birthdayShow = true;
			},
			birthdayConfirm(e) {
				_self.birthdayShow = false;
				_self.birthdayStr = e.year + '-' + e.month + '-' + e.day;
				console.log('birthday = ', e);
			},
			heightInput(e) {
				_self.heightStr = e.detail.value;
				console.log('_self.heightStr  = ', _self.heightStr);
			},
			weightInput(e) {
				_self.weightStr = e.detail.value;
				console.log('_self.weightStr  = ', _self.weightStr);
			},
			workInput(e) {
				_self.workStr = e.detail.value;
				console.log('_self.workStr  = ', _self.workStr);
			},
			incomeInput(e) {
				_self.incomeStr = e.detail.value;
				console.log('_self.incomeStr  = ', _self.incomeStr);
			},
			cityClick() {
				_self.cityShow = true;
			},
			cityConfirm(e) {
				_self.cityShow = false;
				_self.cityStr = e.province.label + e.city.label + e.area.label;
				console.log('地区 = ', e);
			},
			educationClick() {
				_self.educationShow = true;
			},
			educationConfirm(e) {
				_self.educationShow = false;
				_self.educationStr = e[0].label;
			}
		}
	}
</script>

<style>
	.u-page {
		background-color: #f5f5f5;
		height: 100vh;
	}
</style>